<?php
/**
 * All tests runner
 *
 * PHP version 5
 *
 * @category   Web
 * @package    App
 * @subpackage Tests
 * @author     Logger Testenborg <logger.testenborg@data2people.com>
 * @copyright  http://data2people.com
 * @license    Apache License 2.0 http://www.apache.org/licenses/LICENSE-2.0.txt
 * @version    SVN: $Id: $
 *
 */

if (!defined('PHPUnit_MAIN_METHOD')) {
    define('PHPUnit_MAIN_METHOD', 'AllTests::main');
}

/*
 * Include config for tests
 */
require_once dirname(__FILE__). DIRECTORY_SEPARATOR .'testsConfig.php';

/*
 * Include test suits
 */
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'View'
                              .DIRECTORY_SEPARATOR.'AllTests.php';

/*
 * All tests runner class
 */
class AllTests {
    
    public static function main() {
        PHPUnit_TextUI_TestRunner::run(self::suite());
    }

    public static function suite() {
        /*
         * 'App All Tests' - will be a title in the report
         */
        $suite = new PHPUnit_Framework_TestSuite('App All Tests');
        /*
         * Include particular test suite
         */
        $suite->addTestSuite('View_AllTests');

        /*
         * Filter directories in order to prevent them to be included in coverage
         * analysis becasue we don't wanna see our libraries there.
         */
        PHPUnit_Util_Filter::addDirectoryToFilter(dirname(__FILE__));
        PHPUnit_Util_Filter::addDirectoryToFilter(dirname(__FILE__)."/../../libs");
        /*
         * Add our application directory to the whitelist
         */
        PHPUnit_Util_Filter::addDirectoryToWhitelist(dirname(__FILE__)."/../../App");
        
        return $suite;
    }
}

/*
 * Run suit
 */
if (PHPUnit_MAIN_METHOD == 'AllTests::main') {
    AllTests::main();
}